package cn.wolfcode.shop.cloud.mq;

import cn.wolfcode.shop.cloud.web.controller.SeckillOrderController;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(
        consumerGroup = MQConstants.ORDER_FAIL_NOTIFY_GROUP,
        topic = MQConstants.SECKILL_ORDER,
        messageModel = MessageModel.BROADCASTING,
        selectorExpression = MQConstants.ORDER_FAIL_NOTIFY_TAG
)
@Component
public class MQCreateBroadMQListener implements RocketMQListener<Long> {
    @Override
    /**
     * 修改本地表示
     */
    public void onMessage(Long  seckillId) {
        System.out.println("进入广播队列");
        SeckillOrderController.isFlag.put(seckillId,false);
    }
}